<!--
 * @Description: 
 * @Author: william
 * @Date: 2025-06-05 14:15:06
 * @LastEditors: william
 * @LastEditTime: 2025-09-17 17:49:35
-->
<template>
  <nw-PageTitle :title="$t('pages.system')" />
  <nw-PageContainer isTabbar>
    <scroll-view class="scroll-content" scroll-y>
      <view class="lists">
        <navigator url="/pages/system/userManage/index" hover-class="none">
          <view class="list">
            <view class="icon-wrap">
              <image
                :src="getViteImageUrl('system/userManage.png')"
                mode="aspectFit"
                class="l-icon"
              />
            </view>
            <view class="l-content" style="border-width: 0rpx">
              <view class="l-left">
                <view class="text">{{ $t('system.userManage') }}</view>
              </view>
              <ForwardIcons />
            </view>
          </view>
        </navigator>
        <navigator url="/pages/system/deviceManage/index" hover-class="none">
          <view class="list">
            <view class="icon-wrap">
              <image
                :src="getViteImageUrl('system/deviceManage.png')"
                mode="aspectFit"
                class="l-icon"
              />
            </view>
            <view class="l-content">
              <view class="l-left">
                <view class="text">{{ $t('system.deviceManage') }}</view>
              </view>
              <ForwardIcons />
            </view>
          </view>
        </navigator>
        <navigator url="/pages/system/cookingManage/index" hover-class="none">
          <view class="list">
            <view class="icon-wrap">
              <image
                :src="getViteImageUrl('system/cookingManage.png')"
                mode="aspectFit"
                class="l-icon"
              />
            </view>
            <view class="l-content">
              <view class="l-left">
                <view class="text">烹饪管理</view>
              </view>
              <ForwardIcons />
            </view>
          </view>
        </navigator>
        <navigator url="/pages/system/seasoningManage/index" hover-class="none">
          <view class="list">
            <view class="icon-wrap">
              <image
                :src="getViteImageUrl('system/seasoningManage.png')"
                mode="aspectFit"
                class="l-icon"
              />
            </view>
            <view class="l-content">
              <view class="l-left">
                <view class="text">调料管理</view>
              </view>
              <ForwardIcons />
            </view>
          </view>
        </navigator>
        <navigator url="/pages/system/cookingDiary/index" hover-class="none">
          <view class="list">
            <view class="icon-wrap">
              <image
                :src="getViteImageUrl('system/cookingDiary.png')"
                mode="aspectFit"
                class="l-icon"
              />
            </view>
            <view class="l-content">
              <view class="l-left">
                <view class="text">烹饪日志</view>
              </view>
              <ForwardIcons />
            </view>
          </view>
        </navigator>
        <navigator url="/pages/system/systemLog/index" hover-class="none">
          <view class="list">
            <view class="icon-wrap">
              <image
                :src="getViteImageUrl('system/systemLog.png')"
                mode="aspectFit"
                class="l-icon"
              />
            </view>
            <view class="l-content">
              <view class="l-left">
                <view class="text">系统日志</view>
              </view>
              <ForwardIcons />
            </view>
          </view>
        </navigator>
        <navigator url="/pages/system/voiceBroad/index" hover-class="none">
          <view class="list">
            <!-- @click="handleVoiceBroad" -->
            <view class="icon-wrap">
              <image
                :src="getViteImageUrl('system/voiceBroad.png')"
                mode="aspectFit"
                class="l-icon"
              />
            </view>
            <view class="l-content">
              <view class="l-left">
                <view class="text">{{ $t('system.voiceBroad') }}</view>
              </view>
              <ForwardIcons />
            </view>
          </view>
        </navigator>
        <!-- <navigator url="/pages/system/netConfigSet/index" hover-class="none">
          <view class="list">
            <view class="icon-wrap">
              <image
                :src="getViteImageUrl('system/netConfigSet.png')"
                mode="aspectFit"
                class="l-icon"
              />
            </view>
            <view class="l-content">
              <view class="l-left">
                <view class="text">网络配置</view>
              </view>
              <ForwardIcons />
            </view>
          </view>
        </navigator>
        <navigator url="/pages/system/elecScaleSet/index" hover-class="none">
          <view class="list">
            <view class="icon-wrap">
              <image
                :src="getViteImageUrl('system/elecScaleSet.png')"
                mode="aspectFit"
                class="l-icon"
              />
            </view>
            <view class="l-content">
              <view class="l-left">
                <view class="text">电子秤设置</view>
              </view>
              <ForwardIcons />
            </view>
          </view>
        </navigator>
        <navigator url="/pages/system/cookerHoodSet/index" hover-class="none">
          <view class="list">
            <view class="icon-wrap">
              <image
                :src="getViteImageUrl('system/cookerHoodSet.png')"
                mode="aspectFit"
                class="l-icon"
              />
            </view>
            <view class="l-content">
              <view class="l-left">
                <view class="text">油烟机设置</view>
              </view>
              <ForwardIcons />
            </view>
          </view>
        </navigator> -->
        <navigator url="/pages/system/upgradeManage/index" hover-class="none">
          <view class="list">
            <!-- @click="handleCheckUpdate" -->
            <view class="icon-wrap">
              <image
                :src="getViteImageUrl('system/upgradeManage.png')"
                mode="aspectFit"
                class="l-icon"
              />
            </view>
            <view class="l-content">
              <view class="l-left">
                <view class="text">{{ $t('system.upgradeManage') }}</view>
              </view>
              <view class="l-right">
                <view class="text">v{{ versionName }}</view>
                <ForwardIcons />
              </view>
            </view>
          </view>
        </navigator>
        <navigator url="/pages/system/versionInfo/index" hover-class="none">
          <view class="list">
            <view class="icon-wrap">
              <image
                :src="getViteImageUrl('system/versionInfo.png')"
                mode="aspectFit"
                class="l-icon"
              />
            </view>
            <view class="l-content">
              <view class="l-left">
                <view class="text">{{ $t('system.versionInfo') }}</view>
              </view>
              <ForwardIcons />
            </view>
          </view>
        </navigator>
        <navigator url="/pages/system/protocol/index" hover-class="none">
          <view class="list">
            <view class="icon-wrap">
              <image
                :src="getViteImageUrl('system/versionInfo.png')"
                mode="aspectFit"
                class="l-icon"
              />
            </view>
            <view class="l-content">
              <view class="l-left">
                <view class="text">协议调试</view>
              </view>
              <ForwardIcons />
            </view>
          </view>
        </navigator>
        <!-- <navigator url="/pages/log/index" hover-class="none">
          <view class="list">
            <view class="icon-wrap">
              <image
                :src="getViteImageUrl('system/versionInfo.png')"
                mode="aspectFit"
                class="l-icon"
              />
            </view>
            <view class="l-content">
              <view class="l-left">
                <view class="text">日志调试</view>
              </view>
              <ForwardIcons />
            </view>
          </view>
        </navigator> -->
      </view>
    </scroll-view>
  </nw-PageContainer>
  <nw-Tabbar value="system" />
</template>

<script setup>
const { versionName } = storeToRefs(useAppStore())

onMounted(_ => {})

const handleVoiceBroad = _ => {
  g_utils.showToast('暂未开放此功能，敬请期待！')
}
const handleCheckUpdate = async _ => {
  // const versionCode = await g_utils.checkUpdate()
  // console.log('versionCode', versionCode)
  g_utils.showToast(g_t('system.latestVersion'))
}
</script>

<style lang="scss" scoped>
.scroll-content {
  height: 100%;
  max-height: 100%;
}

.lists {
  display: inline-block;
  width: 100%;
  margin: 30rpx 0;
  background-color: var(--bg-color);
  .list {
    display: flex;
    align-items: center;
    padding-left: 34rpx;
    .icon-wrap {
      width: 42rpx;
      height: 42rpx;
      border-radius: 10rpx;
      overflow: hidden;
      .l-icon {
        width: 100%;
        height: 100%;
      }
    }
    .l-content {
      flex: 1;
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 80rpx;
      margin-left: 18rpx;
      padding-right: 36rpx;
      border-top: 1rpx solid var(--border-color);
    }
    .l-left {
      display: flex;
      align-items: center;
      .text {
        font-size: 24rpx;
        font-weight: 400;
        color: var(--color-000);
      }
    }
    .l-right {
      display: flex;
      align-items: center;
      .text {
        margin-right: 18rpx;
        font-size: 22rpx;
        color: var(--main-theme);
      }
    }
  }
}
</style>
